# Makefile

ENABLESOUND := 1

CXX := g++
RM := rm -rf
TOLUA := tools/tolua.exe

LIBS := -lmingw32 -lSDLmain -lSDL \
	-lminizip -lz -ljpeg -lpng \
	-lopengl32 -llua -lluabind

ifeq (1,$(ENABLESOUND))
LIBS += -lopenal32 -lvorbisfile -lvorbis -logg
endif

CXXFLAGS := -g3 -Wall -Iinclude -I. -IC:/boost_1_37_0 -DSKYID_DEBUG
LDFLAGS := -mwindows -Llib $(LIBS)

ifeq (0,$(ENABLESOUND))
CXXFLAGS += -DSKYID_DISABLE_SOUND
endif

OBJS := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp))

all: sky-id

%.o: %.cpp
	$(CXX) -c $(CXXFLAGS) $< -o $@

sky-id: $(OBJS)
	$(CXX) -o sky-id $(OBJS) $(LDFLAGS)

clean:
	$(RM) src/*.o sky-id.exe
